<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面二</title>
</head>

<body>
    <script>
        let cookie = document.cookie;
        console.log(`当前的 cookie 值为：${cookie}`);
        setInterval(function(){
            if(document.cookie !== cookie){
                console.log(`cookie 有更新，最新的值为 ${document.cookie}`);
                cookie = document.cookie;
            }
        },1000);
    </script>
</body>

</html>